<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style type="text/css">
body {
	background-color: #fff;
	word-wrap: break-word;
	font-family: "Microsoft YaHei";
	font-size: 16px;
}

img {
	cursor: pointer;
}

::-webkit-scrollbar {
	width: 7px;
	height: 7px
}

::-webkit-scrollbar-track {
	background-color: rgba(0, 0, 0, .1)
}

::-webkit-scrollbar-thumb {
	background-color: rgba(0, 0, 0, .3)
}

::-webkit-scrollbar-thumb:hover {
	background-color: rgba(0, 0, 0, .5)
}

::-webkit-scrollbar-thumb:active {
	background-color: rgba(0, 0, 0, .7)
}
</style>
<script type="text/javascript">
	/**
	 * 插入 Html 在光标的位置
	 */
	function insertHtmlAtCursor(html) {
		if (document.body.childNodes.length) {
			insertHtml(html);
		} else {
			appendHtml(html);
		}
	};

	/**
	 * 插入内容
	 */
	function insertHtml(html) {
		var range, node;
		var hasSelection = window.getSelection;
		var selection = window.getSelection();
		if (hasSelection && selection.rangeCount > 0 && selection.getRangeAt) {
			range = window.getSelection().getRangeAt(0);
			var element = document.createElement("div");
			element.innerHTML = html;
			var nodes = element.childNodes;
			var l = nodes.length;
			for (var i = 0; i < l; i++) {
				node = nodes[i];
				range.insertNode(node);
			}
			if (node) {
				range.setStartAfter(node);
				range.collapse(true);
				selection.removeAllRanges();
				selection.addRange(range);
			}
		} else {
			appendHtml(html);
		}
	};

	/**
	 * 设置内容
	 */
	function initHTML(html) {
		document.body.innerHTML = html;
	};

	/**
	 * 获得Body内容
	 */
	function getBodyHTML() {
		return document.body.innerHTML;
	};

	/**
	 * 追加内容
	 */
	function appendHtml(html) {
		var element = document.createElement('div');
		element.innerHTML = html;
		node = element.childNodes[0];
		document.body.appendChild(node);
	};
	
	function Onerror(src) {
		console.log(src)
		if(window.$App) {
			window.$App.log(src)
		}	
	}
	function OnImageLoad(src) {
		// console.log(src)
		if(window.$App) {
			window.$App.log(src)
		}			
		var dom = document.getElementById('DomTIP');
		console.log('success')
		dom.innerHTML = '122'
	}
	function OnImageError(src) {
		console.log(src)
		if(window.$App) {
			window.$App.log('123')
		}	
		var dom = document.getElementById('DomTIP');
		console.log('error')
		dom.innerHTML = src.type
	}
</script>
</head>
<body>
    <div id="DomTIP">这是测试页面</div>
	<div id="w-e-image-container-3"
		class="w-e-image-container w-e-selected-image-container">
		<img src="">
		<div class="w-e-image-dragger left-top"></div>
		<div class="w-e-image-dragger right-top"></div>
		<div class="w-e-image-dragger left-bottom"></div>
		<div class="w-e-image-dragger right-bottom"></div>
	</div>
</body>
</html>